﻿using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;
using Microsoft.Xna.Framework.Net;
using Microsoft.Xna.Framework.Storage;

namespace Sudum
{
    class Camera
    {
        public Camera(Vector3 camPos, Vector3 camTarget)
        {
            EyePos = camPos;
            Target = camTarget;
        }

        public Matrix GetView()
        {
            // build view matrix here
            mView = Matrix.CreateLookAt(EyePos, Target, Vector3.UnitY);
            return mView;
        }

        public Matrix GetProjection()
        {
            GraphicsDevice G = Sudum.Me.GraphicsDevice;
            mProj = Matrix.CreatePerspectiveFieldOfView(
                MathHelper.ToRadians(45.0f),
                G.Viewport.AspectRatio, 1.0f, 10000.0f);
            return mProj;
        }

        Matrix mView, mProj;
        public Vector3 EyePos { get; set; }
        public Vector3 Target { get; set; }
    }
}
